3.8.2 \(\int \frac {(a+i a \tan (e+f x))^3 (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^6} \, dx\) [702]

Optimal. Leaf size=127 \[ \frac {2 a^3 (i A+B)}{3 c^6 f (i+\tan (e+f x))^6}-\frac {4 a^3 (A-2 i B)}{5 c^6 f (i+\tan (e+f x))^5}-\frac {a^3 (i A+5 B)}{4 c^6 f (i+\tan (e+f x))^4}-\frac {i a^3 B}{3 c^6 f (i+\tan (e+f x))^3} \]

[Out]

2/3*a^3*(I*A+B)/c^6/f/(I+tan(f*x+e))^6-4/5*a^3*(A-2*I*B)/c^6/f/(I+tan(f*x+e))^5-1/4*a^3*(I*A+5*B)/c^6/f/(I+tan
(f*x+e))^4-1/3*I*a^3*B/c^6/f/(I+tan(f*x+e))^3

________________________________________________________________________________________

Rubi [A]
time = 0.12, antiderivative size = 127, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78} \begin {gather*} -\frac {a^3 (5 B+i A)}{4 c^6 f (\tan (e+f x)+i)^4}-\frac {4 a^3 (A-2 i B)}{5 c^6 f (\tan (e+f x)+i)^5}+\frac {2 a^3 (B+i A)}{3 c^6 f (\tan (e+f x)+i)^6}-\frac {i a^3 B}{3 c^6 f (\tan (e+f x)+i)^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^6,x]

[Out]

(2*a^3*(I*A + B))/(3*c^6*f*(I + Tan[e + f*x])^6) - (4*a^3*(A - (2*I)*B))/(5*c^6*f*(I + Tan[e + f*x])^5) - (a^3
*(I*A + 5*B))/(4*c^6*f*(I + Tan[e + f*x])^4) - ((I/3)*a^3*B)/(c^6*f*(I + Tan[e + f*x])^3)

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 3669

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a*(c/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \frac {(a+i a \tan (e+f x))^3 (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^6} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {(a+i a x)^2 (A+B x)}{(c-i c x)^7} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (-\frac {4 i a^2 (A-i B)}{c^7 (i+x)^7}+\frac {4 a^2 (A-2 i B)}{c^7 (i+x)^6}+\frac {a^2 (i A+5 B)}{c^7 (i+x)^5}+\frac {i a^2 B}{c^7 (i+x)^4}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {2 a^3 (i A+B)}{3 c^6 f (i+\tan (e+f x))^6}-\frac {4 a^3 (A-2 i B)}{5 c^6 f (i+\tan (e+f x))^5}-\frac {a^3 (i A+5 B)}{4 c^6 f (i+\tan (e+f x))^4}-\frac {i a^3 B}{3 c^6 f (i+\tan (e+f x))^3}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 2.25, size = 112, normalized size = 0.88 \begin {gather*} \frac {a^3 (3 (-27 i A+B) \cos (e+f x)+10 (-3 i A+B) \cos (3 (e+f x))-(A+3 i B) (9 \sin (e+f x)+10 \sin (3 (e+f x)))) (\cos (9 e+12 f x)+i \sin (9 e+12 f x))}{960 c^6 f (\cos (f x)+i \sin (f x))^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^6,x]

[Out]

(a^3*(3*((-27*I)*A + B)*Cos[e + f*x] + 10*((-3*I)*A + B)*Cos[3*(e + f*x)] - (A + (3*I)*B)*(9*Sin[e + f*x] + 10
*Sin[3*(e + f*x)]))*(Cos[9*e + 12*f*x] + I*Sin[9*e + 12*f*x]))/(960*c^6*f*(Cos[f*x] + I*Sin[f*x])^3)

________________________________________________________________________________________

Maple [A]
time = 0.29, size = 90, normalized size = 0.71

method result size
derivativedivides \(\frac {a^{3} \left (-\frac {i B}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}-\frac {-4 i A -4 B}{6 \left (i+\tan \left (f x +e \right )\right )^{6}}-\frac {-8 i B +4 A}{5 \left (i+\tan \left (f x +e \right )\right )^{5}}-\frac {i A +5 B}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}\right )}{f \,c^{6}}\) \(90\)
default \(\frac {a^{3} \left (-\frac {i B}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}-\frac {-4 i A -4 B}{6 \left (i+\tan \left (f x +e \right )\right )^{6}}-\frac {-8 i B +4 A}{5 \left (i+\tan \left (f x +e \right )\right )^{5}}-\frac {i A +5 B}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}\right )}{f \,c^{6}}\) \(90\)
risch \(-\frac {a^{3} {\mathrm e}^{12 i \left (f x +e \right )} B}{96 c^{6} f}-\frac {i a^{3} {\mathrm e}^{12 i \left (f x +e \right )} A}{96 c^{6} f}-\frac {{\mathrm e}^{10 i \left (f x +e \right )} B \,a^{3}}{80 c^{6} f}-\frac {3 i {\mathrm e}^{10 i \left (f x +e \right )} A \,a^{3}}{80 c^{6} f}+\frac {{\mathrm e}^{8 i \left (f x +e \right )} B \,a^{3}}{64 c^{6} f}-\frac {3 i {\mathrm e}^{8 i \left (f x +e \right )} A \,a^{3}}{64 c^{6} f}+\frac {a^{3} {\mathrm e}^{6 i \left (f x +e \right )} B}{48 c^{6} f}-\frac {i a^{3} {\mathrm e}^{6 i \left (f x +e \right )} A}{48 c^{6} f}\) \(174\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^6,x,method=_RETURNVERBOSE)

[Out]

1/f*a^3/c^6*(-1/3*I*B/(I+tan(f*x+e))^3-1/6*(-4*I*A-4*B)/(I+tan(f*x+e))^6-1/5*(-8*I*B+4*A)/(I+tan(f*x+e))^5-1/4
*(I*A+5*B)/(I+tan(f*x+e))^4)

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^6,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

Fricas [A]
time = 1.01, size = 93, normalized size = 0.73 \begin {gather*} -\frac {10 \, {\left (i \, A + B\right )} a^{3} e^{\left (12 i \, f x + 12 i \, e\right )} + 12 \, {\left (3 i \, A + B\right )} a^{3} e^{\left (10 i \, f x + 10 i \, e\right )} + 15 \, {\left (3 i \, A - B\right )} a^{3} e^{\left (8 i \, f x + 8 i \, e\right )} + 20 \, {\left (i \, A - B\right )} a^{3} e^{\left (6 i \, f x + 6 i \, e\right )}}{960 \, c^{6} f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^6,x, algorithm="fricas")

[Out]

-1/960*(10*(I*A + B)*a^3*e^(12*I*f*x + 12*I*e) + 12*(3*I*A + B)*a^3*e^(10*I*f*x + 10*I*e) + 15*(3*I*A - B)*a^3
*e^(8*I*f*x + 8*I*e) + 20*(I*A - B)*a^3*e^(6*I*f*x + 6*I*e))/(c^6*f)

________________________________________________________________________________________

Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 332 vs. \(2 (105) = 210\).
time = 0.63, size = 332, normalized size = 2.61 \begin {gather*} \begin {cases} \frac {\left (- 491520 i A a^{3} c^{18} f^{3} e^{6 i e} + 491520 B a^{3} c^{18} f^{3} e^{6 i e}\right ) e^{6 i f x} + \left (- 1105920 i A a^{3} c^{18} f^{3} e^{8 i e} + 368640 B a^{3} c^{18} f^{3} e^{8 i e}\right ) e^{8 i f x} + \left (- 884736 i A a^{3} c^{18} f^{3} e^{10 i e} - 294912 B a^{3} c^{18} f^{3} e^{10 i e}\right ) e^{10 i f x} + \left (- 245760 i A a^{3} c^{18} f^{3} e^{12 i e} - 245760 B a^{3} c^{18} f^{3} e^{12 i e}\right ) e^{12 i f x}}{23592960 c^{24} f^{4}} & \text {for}\: c^{24} f^{4} \neq 0 \\\frac {x \left (A a^{3} e^{12 i e} + 3 A a^{3} e^{10 i e} + 3 A a^{3} e^{8 i e} + A a^{3} e^{6 i e} - i B a^{3} e^{12 i e} - i B a^{3} e^{10 i e} + i B a^{3} e^{8 i e} + i B a^{3} e^{6 i e}\right )}{8 c^{6}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))**6,x)

[Out]

Piecewise((((-491520*I*A*a**3*c**18*f**3*exp(6*I*e) + 491520*B*a**3*c**18*f**3*exp(6*I*e))*exp(6*I*f*x) + (-11
05920*I*A*a**3*c**18*f**3*exp(8*I*e) + 368640*B*a**3*c**18*f**3*exp(8*I*e))*exp(8*I*f*x) + (-884736*I*A*a**3*c
**18*f**3*exp(10*I*e) - 294912*B*a**3*c**18*f**3*exp(10*I*e))*exp(10*I*f*x) + (-245760*I*A*a**3*c**18*f**3*exp
(12*I*e) - 245760*B*a**3*c**18*f**3*exp(12*I*e))*exp(12*I*f*x))/(23592960*c**24*f**4), Ne(c**24*f**4, 0)), (x*
(A*a**3*exp(12*I*e) + 3*A*a**3*exp(10*I*e) + 3*A*a**3*exp(8*I*e) + A*a**3*exp(6*I*e) - I*B*a**3*exp(12*I*e) -
I*B*a**3*exp(10*I*e) + I*B*a**3*exp(8*I*e) + I*B*a**3*exp(6*I*e))/(8*c**6), True))

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 345 vs. \(2 (107) = 214\).
time = 0.96, size = 345, normalized size = 2.72 \begin {gather*} -\frac {2 \, {\left (15 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{11} + 45 i \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{10} - 15 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{10} - 215 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{9} - 390 i \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{8} + 90 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{8} + 738 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} + 24 i \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} + 746 i \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 158 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 738 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 24 i \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 390 i \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 90 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 215 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 45 i \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 15 \, B a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 15 \, A a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{15 \, c^{6} f {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{12}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^6,x, algorithm="giac")

[Out]

-2/15*(15*A*a^3*tan(1/2*f*x + 1/2*e)^11 + 45*I*A*a^3*tan(1/2*f*x + 1/2*e)^10 - 15*B*a^3*tan(1/2*f*x + 1/2*e)^1
0 - 215*A*a^3*tan(1/2*f*x + 1/2*e)^9 - 390*I*A*a^3*tan(1/2*f*x + 1/2*e)^8 + 90*B*a^3*tan(1/2*f*x + 1/2*e)^8 +
738*A*a^3*tan(1/2*f*x + 1/2*e)^7 + 24*I*B*a^3*tan(1/2*f*x + 1/2*e)^7 + 746*I*A*a^3*tan(1/2*f*x + 1/2*e)^6 - 15
8*B*a^3*tan(1/2*f*x + 1/2*e)^6 - 738*A*a^3*tan(1/2*f*x + 1/2*e)^5 - 24*I*B*a^3*tan(1/2*f*x + 1/2*e)^5 - 390*I*
A*a^3*tan(1/2*f*x + 1/2*e)^4 + 90*B*a^3*tan(1/2*f*x + 1/2*e)^4 + 215*A*a^3*tan(1/2*f*x + 1/2*e)^3 + 45*I*A*a^3
*tan(1/2*f*x + 1/2*e)^2 - 15*B*a^3*tan(1/2*f*x + 1/2*e)^2 - 15*A*a^3*tan(1/2*f*x + 1/2*e))/(c^6*f*(tan(1/2*f*x
 + 1/2*e) + I)^12)

________________________________________________________________________________________

Mupad [B]
time = 9.09, size = 140, normalized size = 1.10 \begin {gather*} -\frac {-\frac {a^3\,\left (-B+A\,7{}\mathrm {i}\right )}{60}+\frac {a^3\,\mathrm {tan}\left (e+f\,x\right )\,\left (18\,A-B\,6{}\mathrm {i}\right )}{60}+\frac {B\,a^3\,{\mathrm {tan}\left (e+f\,x\right )}^3\,1{}\mathrm {i}}{3}+\frac {a^3\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (15\,B+A\,15{}\mathrm {i}\right )}{60}}{c^6\,f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^6+{\mathrm {tan}\left (e+f\,x\right )}^5\,6{}\mathrm {i}-15\,{\mathrm {tan}\left (e+f\,x\right )}^4-{\mathrm {tan}\left (e+f\,x\right )}^3\,20{}\mathrm {i}+15\,{\mathrm {tan}\left (e+f\,x\right )}^2+\mathrm {tan}\left (e+f\,x\right )\,6{}\mathrm {i}-1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i)^3)/(c - c*tan(e + f*x)*1i)^6,x)

[Out]

-((a^3*tan(e + f*x)*(18*A - B*6i))/60 - (a^3*(A*7i - B))/60 + (B*a^3*tan(e + f*x)^3*1i)/3 + (a^3*tan(e + f*x)^
2*(A*15i + 15*B))/60)/(c^6*f*(tan(e + f*x)*6i + 15*tan(e + f*x)^2 - tan(e + f*x)^3*20i - 15*tan(e + f*x)^4 + t
an(e + f*x)^5*6i + tan(e + f*x)^6 - 1))

________________________________________________________________________________________